// src/i18n/index.ts  (server action)
'use server';
import { cookies } from 'next/headers';
import { defaultLocale, Locale } from './config';
const COOKIE = 'NEXT_LOCALE';

export async function getLocale() {
  return (await cookies()).get(COOKIE)?.value || defaultLocale;
}

export async function setLocale(locale: Locale) {
  (await cookies()).set(COOKIE, locale);
}